package cn.andrewlu.weexshell.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;

import cn.andrewlu.weexshell.beans.SinglePageNav;
import cn.andrewlu.weexshell.beans.WXPage;
import cn.andrewlu.weexshell.ui.widgetes.WXPageContainer;
import cn.andrewlu.weexshell.weex.core.WXAppManager;

/**
 * Created by andrewlu on 2017/6/11.
 */

public class WXPageFragment extends RootFragment {
    private WXPageContainer mContentView;
    private String mPageName;

    public WXPageFragment(String pageName) {
        mPageName = pageName;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        WXPage page = WXAppManager.getInstance().getPage(mPageName);
        mContentView = new WXPageContainer(getContext(), page);
        addLifeCycleListener(mContentView);
        return mContentView.getView();
    }
}
